@page
@{ Layout = "_Layout"; }

<div style="height: 10px"></div>
<el-form v-on:submit.native.prevent ref="form" :model="form" size="small" status-icon label-width="260px">
  <el-form-item label="允许新用户注册">
    <el-radio v-model="form.isUserRegistrationAllowed" :label="true">允许</el-radio>
    <el-radio v-model="form.isUserRegistrationAllowed" :label="false">禁止</el-radio>
    <small class="tips">选择否将禁止新用户注册, 但不影响过去已注册的会员的使用</small>
  </el-form-item>
  <el-form-item label="允许用户注销">
    <el-radio v-model="form.isUserUnRegistrationAllowed" :label="true">允许</el-radio>
    <el-radio v-model="form.isUserUnRegistrationAllowed" :label="false">禁止</el-radio>
    <small class="tips">用户注销将永久删除此用户账户以及帐户中的所有数据</small>
  </el-form-item>
  <el-form-item label="新注册用户需要管理员审核">
    <el-radio v-model="form.isUserRegistrationChecked" :label="true">不需要审核</el-radio>
    <el-radio v-model="form.isUserRegistrationChecked" :label="false">需要管理员审核</el-radio>
  </el-form-item>
  <el-form-item label="强制验证用户手机号码">
    <el-radio :disabled="!isSmsEnabled" v-model="form.isUserForceVerifyMobile" :label="true">启用强制验证</el-radio>
    <el-radio :disabled="!isSmsEnabled" v-model="form.isUserForceVerifyMobile" :label="false">不启用</el-radio>
    <small class="tips">开启强制验证后，系统将强制用户输入并验证手机号码（需要安装短信插件或启用云助手短信功能）</small>
  </el-form-item>
  <el-form-item label="密码最小长度" prop="userPasswordMinLength" :rules="[
    { required: true, message: '请输入密码最小长度' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userPasswordMinLength"></el-input>
    <small class="tips">0代表不限制密码长度</small>
  </el-form-item>
  <el-form-item label="密码规则限制">
    <el-select v-model="form.userPasswordRestriction" class="form-control">
      <el-option :label="getPasswordRestrictionText('LetterAndDigit')" value="LetterAndDigit"></el-option>
      <el-option :label="getPasswordRestrictionText('LetterAndDigitAndSymbol')" value="LetterAndDigitAndSymbol"></el-option>
      <el-option :label="getPasswordRestrictionText('None')" value="None"></el-option>
    </el-select>
  </el-form-item>
  
  <el-form-item label="同一IP注册间隔限制（单位：分钟）" prop="userRegistrationMinMinutes" :rules="[
    { required: true, message: '请输入同一IP注册间隔限制' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userRegistrationMinMinutes"></el-input>
    <small class="tips">同一IP在本时间间隔内将只能注册一个账号，0 为不限制</small>
  </el-form-item>

  <el-form-item label="登录失败锁定">
    <el-radio v-model="form.isUserLockLogin" :label="true">开启登录失败锁定</el-radio>
    <el-radio v-model="form.isUserLockLogin" :label="false">不锁定</el-radio>
  </el-form-item>
  <el-form-item v-if="form.isUserLockLogin" label="登录失败锁定（次）" prop="userLockLoginCount" :rules="[
    { required: true, message: '请输入登录失败锁定' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userLockLoginCount"></el-input>
    <small class="tips">一旦登录失败达到指定次数之后用户就会被锁定</small>
  </el-form-item>
  <el-form-item v-if="form.isUserLockLogin" label="用户登录锁定类型">
    <el-select v-model="form.userLockLoginType">
      <el-option value="Hours" label="按小时锁定"></el-option>
      <el-option value="Forever" label="永久锁定"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item v-if="form.isUserLockLogin && form.userLockLoginType === 'Hours'" label="登录锁定时间（小时）" prop="userLockLoginHours" :rules="[
    { required: true, message: '请输入登录锁定时间' },
    { validator: utils.validateInt }
  ]">
    <el-input v-model:number="form.userLockLoginHours"></el-input>
  </el-form-item>
  <el-form-item label="是否禁用验证码">
    <el-radio v-model="form.isUserCaptchaDisabled" :label="true">禁用</el-radio>
    <el-radio v-model="form.isUserCaptchaDisabled" :label="false">启用</el-radio>
    <div class="tips">控制用户中心登录界面是否启用验证码功能</div>
  </el-form-item>
</el-form>

<el-divider></el-divider>
<div style="height: 10px"></div>

<el-row>
  <el-col :span="24" align="center">
    <el-button type="primary" v-on:click="btnSubmitClick" size="small">确 定</el-button>
  </el-col>
</el-row>

@section Scripts{
<script src="/sitefiles/assets/js/admin/settings/usersConfig.js" type="text/javascript"></script> }